<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Person {
            // 构造器
            constructor(name, age) {
                    this.name = name;
                    this.age = age;
                }
                // 原型方法
            run() {
                    console.log(this.name + '跑了');
                }
                // 静态方法
            static jump(num) {
                console.log(num + "跳了");
            }
        }

        class Worker extends Person {
            constructor(name, age, money, company) {
                // 继承父级
                super(name, age)
                this.money = money;
                this.company = company;
            }
        }
        let w1 = new Worker('小黄', 22, 2000, "社区");
        console.log(w1);

        w1.run();
        Person.jump('老黄');

        // let p = new Person('庞博', 23)

        // console.log(p);

        // p.run();

        // // p.jump();

        // Person.jump('老高');
    </script>
</body>

</html>